home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / waitForPlayVideo.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.4 KB  |  68 lines  |  [TEXT/MPS ]

  1. (*
  2.     waitForPlayVideo - Wait until the current play sequence finishes.
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w waitForPlayVideo.p
  7.  
  8.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=8009 -sn Main=waitForPlayVideo ∂
  9.             waitForPlayVideo.p.o "{MPW}"Libraries:interface.o
  10.  
  11.     Copyright © 1987,88 Apple Computer, Inc.
  12.  
  13.     9/87 - Initial coding by Harry R. Chesley.
  14.     2/88 - Changed for new interface specification by Harry R. Chesley.
  15. *)
  16.  
  17. {$R-}
  18.  
  19. {$S waitForPlayVideo }     { Segment name must be the same as the command name. }
  20.  
  21. unit DummyUnit;
  22.  
  23. interface
  24.  
  25. uses MemTypes, QuickDraw, OSIntf, HyperXCmd;
  26.  
  27. procedure EntryPoint(paramPtr: XCmdPtr);
  28.     
  29. implementation
  30.  
  31. type
  32.  
  33. Str31 = String[31];
  34.  
  35. procedure waitForPlayVideo(paramPtr: XCmdPtr); forward;
  36.  
  37. procedure EntryPoint(paramPtr: XCmdPtr);
  38.  
  39.     begin
  40.         waitForPlayVideo(paramPtr);
  41.     end;
  42.  
  43. procedure waitForPlayVideo(paramPtr: XCmdPtr);
  44.  
  45.     var str: str255;
  46.  
  47.     {$I XCmdGlue.inc}
  48.  
  49.     procedure Fail(errMsg: Str255); { set theResult and quit }
  50.         begin
  51.             paramPtr^.returnValue := PasToZero(errMsg);
  52.             exit(waitForPlayVideo);
  53.         end;
  54.  
  55.     {$I VideoUtil.inc}
  56.  
  57.     begin
  58.         if paramPtr^.paramCount <> 0 then Fail('parameter count is not 0');
  59.  
  60.         { Wait until the player is no longer playing. }
  61.         repeat 
  62.             { Clear out any pending input. }
  63.             EvalAndDispose('recvUpTo(empty,0,empty)');
  64.         until not StringEqual(EvalStr('"play" is in videoStatus()'),'true');
  65.     end;
  66.  
  67. end.
  68.